{extends file="../acp.html"}

{block name="title"}{$head_title}{/block}
{block name="content"}
<!-- <div class="formitems inline">  
    <label class="fi-name"><span class="colorRed">*</span>标题：</label>  
    <div class="form-controls">  
        <input type="text" placeholder="" class="xlarge" name="title" id="title" value=""> 
        <span class="fi-help-text hide"></span>
    </div>  
</div> -->

<div class="formitems inline">  
    <label class="fi-name"><span class="colorRed">*</span>推送内容：</label>  
    <div class="form-controls">  
            <script id="editor" name="contents" type="text/plain" style="width:600px;height:400px;"></script>
        <span class="fi-help-text hide"></span>
    </div>  
</div> 

<div class="formitems inline">  
    <label class="fi-name"></label>  
    <div class="form-controls">  
        <span type="submit" class="btn btn-blue" id='app_push'><i class="gicon-check white"></i>发送</span>  
    </div>  
</div>


{/block} 

{block name="js"}
<script type="text/javascript" charset="utf-8" src="__UE__/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="__UE__/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8" src="__UE__/lang/zh-cn/zh-cn.js"></script>
<script>
{literal}   
var ue = UE.getEditor('editor');
$('#app_push').on('click',function(){
    var content = ue.getContent();
    /*var title = $('#title').val();
    if(title == ''){
         popAlert('请填写标题');
        return false;
    }*/
    if(content == '')
    {
        popAlert('请填写推送内容');
        return false;
    }else{
        $.jPops.showLoading();
        $.post('/AcpAppPush/app_push',{'content':content},function(data){
            $.jPops.hideLoading(); 
            
            popAlert(data.message);
        })
    }
}); 
function popAlert(message)
{
    $.jPops.alert({  
        title:"提示",  
        content:message,  
        okBtnTxt:"确定",  
        callback:function(){  
            // console.log("我是alert的回调"); 
            return true;  
        }  
    });
}
{/literal}
</script>
{/block} 

{block name="css"}
<link rel="stylesheet" href="/Public/Css/acp/AcpArticle/add_article.css"  type="text/css"/>
{/block}
